Allow description in schema elements in additon to the description on the level above.#284
Allow description in schema elements in additon to the description on the level above.#284Xarno wants to merge 1 commit intoAuthress-Engineering:release/2.2from
Conversation
|
Before we make any change, we'll need to validate that this indeed valid syntax according to the OAS 3.1+? Can you link me to where |
|
Thanks for the pointer to look again and sorry to have bothered you. That we have sometimes two texts is our problem, and I have a way to join them if needed. |
|
For what it's worth (as well as anyone else that sees this in the future). You can dynamically make adjustments to your spec using this library, that go into affect before render by doing something like this using the recursiveFindAndUpdateAllDescriptionFields(param) {
if (!param || typeof param !== 'object') {
return;
}
if (Array.isArray(param)) {
param.map(p => recursiveFindAndUpdateAllDescriptionFields(p));
return;
}
if (param.description && param.schema.description) {
param.descrption += `<br />${param.schema.description}`;
return;
}
}
onSpecLoaded(data) {
recursiveFindAndUpdateAllDescriptionFields(data.detail);
} |
The kotlin openapi generator put the description for query parameter inside the schema element. So this change allows to render the text from there.
Example:

The change adds the text marked by blue arrows and maintains the purple one.